import request from '@/utils/request'

// 获取商品类型列表
export const getCommodityList = function(params) {
  return request({
    url: '/vm-service/skuClass/search',
    method: 'get',
    params
  })
}

// 新增商品类型
export const addCommodityList = function(data) {
  return request({
    url: '/vm-service/skuClass',
    method: 'post',
    data
  })
}

// 修改商品类型
export const editCommodityList = function(classId, data) {
  return request({
    url: '/vm-service/skuClass/' + classId,
    method: 'put',
    data
  })
}

// 删除商品类型
export const delCommodityList = function(classId) {
  return request({
    url: '/vm-service/skuClass/' + classId,
    method: 'DELETE'
  })
}

// 获取商品列表
export const getCommoditys = function(params) {
  return request({
    url: '/vm-service/sku/search',
    method: 'get',
    params
  })
}

// 新增商品
export const addCommoditys = function(data) {
  return request({
    url: '/vm-service/sku',
    method: 'post',
    data
  })
}

// 修改商品
export const editCommoditys = function(skuId, data) {
  return request({
    url: '/vm-service/sku/' + skuId,
    method: 'put',
    data
  })
}

// 商品数据导入
export const importCommoditys = function(data) {
  return request({
    url: '/vm-service/sku/upload',
    method: 'post',
    data
  })
}

